package data;

import java.util.ArrayList;
import java.util.Observable;

public class ListeIndices extends Observable {
	private ArrayList<Indice> liste;
	
	public ListeIndices(){
		liste = new ArrayList<Indice>() ;
	}
	
	public void add(Indice i){
		System.out.println("[Client][ListeIndices] Nouveau indice: "+i.getLabelIndice());
		liste.add(i);
		setChanged();
		notifyObservers();
	}
	
	public Indice get(int index){
		if (index > liste.size()) return null;
		return liste.get(index);
	}
	
	
	public void clear(){
		liste.clear();
		setChanged();
		notifyObservers();
		
	}

	public int size() {
		return liste.size();
	}
	
}
